//package edu.aysf.config;
//

//
//import feign.codec.Decoder;
//import feign.codec.Encoder;
//import org.springframework.beans.factory.ObjectFactory;
//import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
//import org.springframework.cloud.openfeign.support.SpringDecoder;
//import org.springframework.cloud.openfeign.support.SpringEncoder;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.http.converter.HttpMessageConverter;
//import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
//
//import java.util.ArrayList;
//import java.util.List;
//
//@Configuration
//public class FeignConfig5 {
//
//    // 创建Feign的编码器
//    @Bean
//    public Encoder feignEncoder() {
//        return new SpringEncoder(feignHttpMessageConverter());
//    }
//
//    // 创建Feign的解码器
//    @Bean
//    public Decoder feignDecoder() {
////        return new OptionalDecoder(
////                new ResponseEntityDecoder(new SpringDecoder(feignHttpMessageConverter())));
//        return new SpringDecoder(feignHttpMessageConverter());
//    }
//
//    // 创建并返回HttpMessageConverters对象的工厂方法
//    public ObjectFactory<HttpMessageConverters> feignHttpMessageConverter() {
//        return () -> {
////            List<HttpMessageConverter<?>> converters = Collections.singletonList(new MappingJackson2HttpMessageConverter());
////            return new HttpMessageConverters(converters);
//            List<HttpMessageConverter<?>> converters = new ArrayList<>();
//            converters.add(new MappingJackson2HttpMessageConverter());
//            return new HttpMessageConverters(converters);
//        };
//    }
//}